home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
kcl.lha
/
ustation
/
extract.c
next >
Wrap
C/C++ Source or Header
|
1986-01-17
|
794b
|
57 lines
#include <stdio.h>
#include <ctype.h>
char buffer[1024];
main()
{
register c, i;
START:
c = getchar();
START1:
if (feof(stdin))
goto EXIT;
if (isalpha(c) || c == '_')
goto IDENTIFIER;
if (c == '\'')
goto CHARACTER;
if (c == '"')
goto STRING;
if (c == '/') {
if ((c = getchar()) == '*')
goto COMMENT;
goto START1;
}
goto START;
IDENTIFIER:
for (i = 0; isalnum(c) || c == '_'; c = getchar(), i++)
buffer[i] = c;
buffer[i] = '\0';
if (i < 7)
goto START1;
printf("%s\n", buffer);
goto START1;
CHARACTER:
while ((c = getchar()) != '\'')
if (c == '\\')
getchar();
goto START;
STRING:
while ((c = getchar()) != '"')
if (c == '\\')
getchar();
goto START;
COMMENT:
while (getchar() != '*' || getchar() != '/')
;
goto START;
EXIT:
exit(0);
}